 <?php
 	error_reporting(0);
 	require("phpsqlajax_dbinfo.php");
	require("class/Client.php");
	session_start();
	$cliente = $_SESSION['Client'];

	if(isset($_POST['name'])){	
		$cliente->name = $_POST['name'];
		$cliente->email = $_POST['email'];
		$cliente->update();
		
		#header("Location: configuracoes.php?msg=Seus dados foram atualizados com sucesso !");
		?>
		<script>
            function fecharLogin() {
        	var fechar = document.getElementById('fechar');
			parent.location.reload(true);
			parent.window.location="configuracoes.php?msg=Seus dados foram atualizados com sucesso !";
        	parent.jQuery.fancybox.close(fechar); return false;
			}
            </script>
             <body onLoad="fecharLogin();"> <?php 
		
	}else{
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="shortcut icon" href="img/icone.png" />
<title>Projeto Estacione F&aacute;cil :: Login</title>
<link href="css/estilo.css" rel="stylesheet" type="text/css" />
</head>

<body style="background:none">

<div style="width:300px; height:200px; padding-top:25px; margin:auto;"  id="formulario_cadastro2">
<form action="configuracoesAtualizarDados.php" method="post" id="form">
		<h5>Nome:</h5><input type="text" name="name" value="<?php echo $cliente->name; ?>"><br /><br />
		<h5>E-mail:</h5><input type="text"	name="email" value="<?php echo $cliente->email;?>"><br /><br />
	<input type="submit" value="Enviar">
	</form>
    </div>
</body>
</html>
<?php }?>